\(\int (a+a \csc (c+d x)) (A-A \csc (c+d x)) \sin (c+d x) \, dx\) [16]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 28, antiderivative size = 27 \[ \int (a+a \csc (c+d x)) (A-A \csc (c+d x)) \sin (c+d x) \, dx=\frac {a A \text {arctanh}(\cos (c+d x))}{d}-\frac {a A \cos (c+d x)}{d} \]

[Out]

a*A*arctanh(cos(d*x+c))/d-a*A*cos(d*x+c)/d

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4047, 2672, 327, 212} \[ \int (a+a \csc (c+d x)) (A-A \csc (c+d x)) \sin (c+d x) \, dx=\frac {a A \text {arctanh}(\cos (c+d x))}{d}-\frac {a A \cos (c+d x)}{d} \]

[In]

Int[(a + a*Csc[c + d*x])*(A - A*Csc[c + d*x])*Sin[c + d*x],x]

[Out]

(a*A*ArcTanh[Cos[c + d*x]])/d - (a*A*Cos[c + d*x])/d

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2672

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, a*(Sin[e + f*x]/ff)
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 4047

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)
]*(d_.) + (c_))^(n_.), x_Symbol] :> Dist[((-a)*c)^m, Int[ExpandTrig[(g*csc[e + f*x])^p*cot[e + f*x]^(2*m), (c
+ d*csc[e + f*x])^(n - m), x], x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2
 - b^2, 0] && IntegersQ[m, n] && GeQ[n - m, 0] && GtQ[m*n, 0]

Rubi steps \begin{align*} \text {integral}& = -((a A) \int \cos (c+d x) \cot (c+d x) \, dx) \\ & = \frac {(a A) \text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d} \\ & = -\frac {a A \cos (c+d x)}{d}+\frac {(a A) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d} \\ & = \frac {a A \text {arctanh}(\cos (c+d x))}{d}-\frac {a A \cos (c+d x)}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.70 \[ \int (a+a \csc (c+d x)) (A-A \csc (c+d x)) \sin (c+d x) \, dx=-a A \left (\frac {\cos (c+d x)}{d}-\frac {\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}\right ) \]

[In]

Integrate[(a + a*Csc[c + d*x])*(A - A*Csc[c + d*x])*Sin[c + d*x],x]

[Out]

-(a*A*(Cos[c + d*x]/d - Log[Cos[(c + d*x)/2]]/d + Log[Sin[(c + d*x)/2]]/d))

Maple [A] (verified)

Time = 0.30 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.96

method result size
parallelrisch \(-\frac {A a \left (\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1+\cos \left (d x +c \right )\right )}{d}\) \(26\)
parts \(-\frac {a A \cos \left (d x +c \right )}{d}+\frac {A a \ln \left (\csc \left (d x +c \right )+\cot \left (d x +c \right )\right )}{d}\) \(35\)
derivativedivides \(\frac {-A a \ln \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )-A a \cos \left (d x +c \right )}{d}\) \(36\)
default \(\frac {-A a \ln \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )-A a \cos \left (d x +c \right )}{d}\) \(36\)
norman \(\frac {2 A a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}-\frac {A a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) \(52\)
risch \(-\frac {A a \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {A a \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {A a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}-\frac {A a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}\) \(71\)

[In]

int((a+a*csc(d*x+c))*(A-A*csc(d*x+c))/csc(d*x+c),x,method=_RETURNVERBOSE)

[Out]

-A*a*(ln(tan(1/2*d*x+1/2*c))-1+cos(d*x+c))/d

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.67 \[ \int (a+a \csc (c+d x)) (A-A \csc (c+d x)) \sin (c+d x) \, dx=-\frac {2 \, A a \cos \left (d x + c\right ) - A a \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + A a \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, d} \]

[In]

integrate((a+a*csc(d*x+c))*(A-A*csc(d*x+c))/csc(d*x+c),x, algorithm="fricas")

[Out]

-1/2*(2*A*a*cos(d*x + c) - A*a*log(1/2*cos(d*x + c) + 1/2) + A*a*log(-1/2*cos(d*x + c) + 1/2))/d

Sympy [A] (verification not implemented)

Time = 6.25 (sec) , antiderivative size = 75, normalized size of antiderivative = 2.78 \[ \int (a+a \csc (c+d x)) (A-A \csc (c+d x)) \sin (c+d x) \, dx=A a \left (\begin {cases} - \frac {\cot {\left (c + d x \right )}}{d \csc {\left (c + d x \right )}} & \text {for}\: d \neq 0 \\\frac {x}{\csc {\left (c \right )}} & \text {otherwise} \end {cases}\right ) - A a \left (\begin {cases} \frac {x \cot {\left (c \right )} \csc {\left (c \right )}}{\cot {\left (c \right )} + \csc {\left (c \right )}} + \frac {x \csc ^{2}{\left (c \right )}}{\cot {\left (c \right )} + \csc {\left (c \right )}} & \text {for}\: d = 0 \\- \frac {\log {\left (\cot {\left (c + d x \right )} + \csc {\left (c + d x \right )} \right )}}{d} & \text {otherwise} \end {cases}\right ) \]

[In]

integrate((a+a*csc(d*x+c))*(A-A*csc(d*x+c))/csc(d*x+c),x)

[Out]

A*a*Piecewise((-cot(c + d*x)/(d*csc(c + d*x)), Ne(d, 0)), (x/csc(c), True)) - A*a*Piecewise((x*cot(c)*csc(c)/(
cot(c) + csc(c)) + x*csc(c)**2/(cot(c) + csc(c)), Eq(d, 0)), (-log(cot(c + d*x) + csc(c + d*x))/d, True))

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.22 \[ \int (a+a \csc (c+d x)) (A-A \csc (c+d x)) \sin (c+d x) \, dx=-\frac {A a \cos \left (d x + c\right ) - A a \log \left (\cot \left (d x + c\right ) + \csc \left (d x + c\right )\right )}{d} \]

[In]

integrate((a+a*csc(d*x+c))*(A-A*csc(d*x+c))/csc(d*x+c),x, algorithm="maxima")

[Out]

-(A*a*cos(d*x + c) - A*a*log(cot(d*x + c) + csc(d*x + c)))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 60 vs. \(2 (27) = 54\).

Time = 0.27 (sec) , antiderivative size = 60, normalized size of antiderivative = 2.22 \[ \int (a+a \csc (c+d x)) (A-A \csc (c+d x)) \sin (c+d x) \, dx=-\frac {A a \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right ) - \frac {4 \, A a}{\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1}}{2 \, d} \]

[In]

integrate((a+a*csc(d*x+c))*(A-A*csc(d*x+c))/csc(d*x+c),x, algorithm="giac")

[Out]

-1/2*(A*a*log(abs(-cos(d*x + c) + 1)/abs(cos(d*x + c) + 1)) - 4*A*a/((cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 1
))/d

Mupad [B] (verification not implemented)

Time = 18.68 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.48 \[ \int (a+a \csc (c+d x)) (A-A \csc (c+d x)) \sin (c+d x) \, dx=-\frac {A\,a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {2\,A\,a}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]

[In]

int(sin(c + d*x)*(A - A/sin(c + d*x))*(a + a/sin(c + d*x)),x)

[Out]

- (A*a*log(tan(c/2 + (d*x)/2)))/d - (2*A*a)/(d*(tan(c/2 + (d*x)/2)^2 + 1))